package com.clstu.enum_.homework;

public class HomeWork01 {
    public static void main(String[] args) {
        System.out.println(Frock.getNextNum());
        System.out.println(Frock.getNextNum());
        Frock n1 = new Frock();
        Frock n2 = new Frock();
        Frock n3 = new Frock();
        System.out.println(n1.getSerialNumber());
        System.out.println(n2.getSerialNumber());
        System.out.println(n3.getSerialNumber());

    }
}
class Frock{
    private int serialNumber;
    private static int currentNum=100000;

    public Frock() {
        this.serialNumber = getNextNum();
    }

    public static int getNextNum(){
        currentNum+=100;
        return currentNum;
    }

    public int getSerialNumber() {
        return serialNumber;
    }
}